using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Blazing.UI.Cms.Admin.Usercontrols.Extension
{
    public partial class EditAddressTypes : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.MaintainScrollPositionOnPostBack = true;
        }

        protected void TurnPanelsOff()
        {
            PanelAddressTypes.Visible = false;
            PanelCountries.Visible = false;
            PanelCurrency.Visible = false;
            PanelState.Visible = false;
        }

        protected void DetailsView_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
        {
            ((DetailsView)sender).Visible = false;
        }

        protected void LinkButtonInsertAddressType_Click(object sender, EventArgs e)
        {
            DetailsView1.Visible = true;
        }

        protected void LinkButtonInsertState_Click(object sender, EventArgs e)
        {
            DetailsView2.Visible = true;
        }

        protected void LinkButtonInsertCountry_Click(object sender, EventArgs e)
        {
            DetailsView3.Visible = true;
        }

        protected void LinkButtonInsertCurrency_Click(object sender, EventArgs e)
        {
            DetailsView4.Visible = true;
        }

        protected void DetailsView_ItemCommand(object sender, DetailsViewCommandEventArgs e)
        {
            //if (e.CommandName == "Cancel")
            //{
            //    ((DetailsView)sender).Visible = false;
            //}
        }

        protected void LinkButtonAddressTypes_Click(object sender, EventArgs e)
        {
           TurnPanelsOff();
            PanelAddressTypes.Visible = true;
        }

        protected void LinkButtonCountry_Click(object sender, EventArgs e)
        {
            TurnPanelsOff();
            PanelCountries.Visible = true;
        }

        protected void LinkButtonCurrency_Click(object sender, EventArgs e)
        {
            TurnPanelsOff();
            PanelCurrency.Visible = true;
        }

        protected void LinkButtonState_Click(object sender, EventArgs e)
        {
            TurnPanelsOff();
            PanelState.Visible = true;
        }
    }
}